package router

import (
	"tosServer/internal/app/dav"
	"tosServer/internal/app/demo"
	"tosServer/internal/app/tos"
)

func (r *Route) api() {
	apiGroup := r.httpRouter.Group("/api")
	{
		apiObjGroup := apiGroup.Group("/object")
		{
			apiObjGroup.Any("/rename", (&tos.Object{}).Rename)
			apiObjGroup.Any("/symlink", (&tos.Object{}).Symlink)
			apiObjGroup.Any("/copy", (&tos.Object{}).Copy)
			apiObjGroup.Any("/batch_copy", (&tos.Object{}).BatchCopy)
		}

		apiDemoGroup := apiGroup.Group("/demo")
		{
			apiDemoGroup.Any("/test", (&demo.Demo{}).Test)
			apiDemoGroup.Any("/test1", (&demo.Demo{}).Test1)
		}

		apiDavGroup := apiGroup.Group("/dav")
		{
			apiDavGroup.Any("/create_user", (&dav.Dav{}).CreateUser)
			apiDavGroup.Any("/update_user", (&dav.Dav{}).UpdateUser)
			apiDavGroup.Any("/get_user_role_info", (&dav.Dav{}).GetUserRoleInfo)
			apiDavGroup.Any("/create_user_role", (&dav.Dav{}).CreateUserRole)
			apiDavGroup.Any("/update_user_role", (&dav.Dav{}).UpdateUserRole)
		}
	}
}
